import request from '@/config/axios'

export interface TenantFileVO {
  id: number
  remark: string
  ownerUserId: number
  attachment: string
}

// 查询租户附件列表
export const getTenantFilePage = async (params) => {
  return await request.get({ url: `/system/tenant-file/page`, params })
}

// 查询租户附件详情
export const getTenantFile = async (id: number) => {
  return await request.get({ url: `/system/tenant-file/get?id=` + id })
}

// 新增租户附件
export const createTenantFile = async (data: TenantFileVO) => {
  return await request.post({ url: `/system/tenant-file/create`, data })
}

// 修改租户附件
export const updateTenantFile = async (data: TenantFileVO) => {
  return await request.put({ url: `/system/tenant-file/update`, data })
}

// 删除租户附件
export const deleteTenantFile = async (id: number) => {
  return await request.delete({ url: `/system/tenant-file/delete?id=` + id })
}

// 导出租户附件 Excel
export const exportTenantFile = async (params) => {
  return await request.download({ url: `/system/tenant-file/export-excel`, params })
}

// ====================== 超管模式
// 查询租户附件列表
export const getTenantFilePageByAdmin = async (params) => {
  return await request.get({ url: `/system/tenant-file/page-by-admin`, params })
}
